package com.osgi.desktop.ui.plugins.model;

import com.onetwork.core.model.CoreTableModel;
import com.osgi.desktop.domain.SiteUpdate;

public class SiteUpdateTableModel extends CoreTableModel<SiteUpdate> {
    private static final long serialVersionUID = 1L;
    public SiteUpdateTableModel(){
        super(new String[]{"Nome","Url"});
    }

    @Override
    public Class getColumnClass(int columnIndex) {
        return super.getColumnClass(columnIndex);
    }
    
    @Override
    public boolean isCellEditable(int row, int column) {
        return false;
    }

    @Override
    public void setValueAt(Object aValue, int row, int column) {
        super.setValueAt(aValue, row, column);
    }

    @Override
    public Object getValueAt(int linha, int coluna) {
        Object retorno = null;
        SiteUpdate siteUpdate = this.objects.get(linha);
        switch(coluna) {
            case 0:
                retorno = siteUpdate.getNome();
                break;    
            case 1:
                retorno = siteUpdate.getUrl();
                break;     
        }
        return retorno;
    }
}